package com.xwolf.rmi.configuration;

import com.xwolf.rmi.RMIExService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.remoting.rmi.RmiProxyFactoryBean;

/**
 * @author ming
 * @Description:
 * @create 2019-01-26 9:09 PM
 **/
@Configuration
public class RMIClientConfig {

    @Bean(name = "rmiService")
    public RmiProxyFactoryBean initRmiProxyFactoryBean() {
        RmiProxyFactoryBean factoryBean = new RmiProxyFactoryBean();
        factoryBean.setServiceUrl("rmi://rmi-server:6666/rmiService");
        factoryBean.setServiceInterface(RMIExService.class);
        return factoryBean;
    }
}
